import axios from "./api"; // 倒入 api
import config from "./config.js"; // 倒入默认配置
export const BASEURL = config.baseURL;

// if (BASEURL == "/api") {
//   BASEURL = "http://data.lilikq.com/ayc/";
// }

/* 将所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 */

// 系统管理-用户管理-获取用户列表
export const GETUSERSEARCH = (params) => {
  return axios({
    url: "user/search",
    method: "GET",
    params,
  });
};

// 系统管理-用户管理-新增用户-获取角色列表
export const GETROLESIMPLELIST = (params) => {
  return axios({
    url: "role/simplelist",
    method: "GET",
    params,
  });
};

// 系统管理-用户管理-新增用户-获取一级组织机构
export const GETORGANIZATIONSIMPLEROOT = (params) => {
  return axios({
    url: "organization/simpleroot",
    method: "GET",
    params,
  });
};

// 系统管理-用户管理-编辑用户-获取用户详情
export const GETUSERINFO = (params) => {
  return axios({
    url: "user/info",
    method: "GET",
    params,
  });
};

// 系统管理-用户管理-删除用户
export const DELETEUSERINFO = (params) => {
  return axios({
    url: "user/delete",
    method: "GET",
    params,
  });
};

// 系统管理-用户管理-新增用户
export const ADDUSERINFO = (params) => {
  return axios({
    url: "user/add",
    method: "POST",
    data: params,
  });
};

// 系统管理-用户管理-编辑用户
export const EDITUSERINFO = (params) => {
  return axios({
    url: "user/edit",
    method: "POST",
    data: params,
  });
};

// 系统管理-角色管理-获取角色列表分页
export const GETROLESEARCH = (params) => {
  return axios({
    url: "role/search",
    method: "GET",
    params,
  });
};

// 系统管理-角色管理-获取角色选中
export const GETMENUCHECKEDTREE = (params) => {
  return axios({
    url: "menu/checkedtree",
    method: "GET",
    params,
  });
};

// 系统管理-角色管理-新增角色
export const ADDROLE = (params) => {
  return axios({
    url: "role/add",
    method: "POST",
    data: params,
  });
};

// 系统管理-角色管理-获取角色信息
export const GETROLEINFO = (params) => {
  return axios({
    url: "role/info",
    method: "GET",
    params,
  });
};

// 系统管理-角色管理-编辑角色
export const EDITROLEINFO = (params) => {
  return axios({
    url: "role/edit",
    method: "POST",
    data: params,
  });
};

// 系统管理-角色管理-删除角色
export const DELETEROLE = (params) => {
  return axios({
    url: "role/delete",
    method: "GET",
    params,
  });
};

// 系统管理-菜单管理-获取菜单列表
export const GETMENUSEARCH = (params) => {
  return axios({
    url: "menu/search",
    method: "GET",
    params,
  });
};

// 系统管理-菜单管理- 获取菜单子节点
export const GETMENUCHILDREN = (params) => {
  return axios({
    url: "menu/children",
    method: "GET",
    params,
  });
};

// 系统管理-菜单管理- 获取权限菜单
export const GETPERMTREE = (params) => {
  return axios({
    url: "menu/permtree",
    method: "GET",
    params,
  });
};

// 系统管理-菜单管理- 获取页面权限菜单
export const GETSUBTREE = (params) => {
  return axios({
    url: "menu/subtree",
    method: "GET",
    params,
  });
};

// 系统管理-菜单管理- 新增菜单
export const ADDMENU = (params) => {
  return axios({
    url: "menu/add",
    method: "POST",
    data: params,
  });
};

// 系统管理-菜单管理- 获取菜单信息
export const GETMENUINFO = (params) => {
  return axios({
    url: "menu/info",
    method: "GET",
    params,
  });
};

// 系统管理-菜单管理- 编辑菜单
export const EDITMENUINFO = (params) => {
  return axios({
    url: "menu/edit",
    method: "POST",
    data: params,
  });
};

// 系统管理-菜单管理- 删除菜单
export const DELETEMENU = (params) => {
  return axios({
    url: "menu/delete",
    method: "GET",
    params,
  });
};

// 系统管理-组织管理（部门管理）-获取组织树
export const GETORGANIZATIONTREE = (params) => {
  return axios({
    url: "organization/orgtree",
    method: "GET",
    params,
  });
};

// 系统管理-组织管理（部门管理）-获取组织列表（分页）
export const ORGANIZATIONSEARCH = (params) => {
  return axios({
    url: "organization/search",
    method: "GET",
    params,
  });
};

// 系统管理-组织管理（部门管理）-获取组织-子节点
export const GETORGANIZATIONCHILDREN = (params) => {
  return axios({
    url: "organization/children",
    method: "GET",
    params,
  });
};

// 系统管理-组织管理（部门管理）-获取组织列表（不分页）
export const ORGANIZATIONSIMPLEROOT = (params) => {
  return axios({
    url: "organization/simpleroot",
    method: "GET",
    params,
  });
};

// 系统管理-组织管理（部门管理）-获取组织-子节点
export const GETORGANIZATIONSIMPLELIST = (params) => {
  return axios({
    url: "organization/simplelist",
    method: "GET",
    params,
  });
};

// 系统管理-组织管理（部门管理）-新增部门
export const ADDORGANIZATION = (params) => {
  return axios({
    url: "organization/add",
    method: "POST",
    data: params,
  });
};

// 系统管理-组织管理（部门管理）-获取部门信息
export const GETORGANIZATIONINFO = (params) => {
  return axios({
    url: "organization/info",
    method: "GET",
    params,
  });
};

// 系统管理-组织管理（部门管理）- 编辑组织
export const EDITORGANIZATION = (params) => {
  return axios({
    url: "organization/edit",
    method: "POST",
    data: params,
  });
};

// 系统管理-组织管理（部门管理）- 删除组织
export const DELETEORGANIZATION = (params) => {
  return axios({
    url: "organization/delete",
    method: "GET",
    params,
  });
};

// 系统管理-操作日志-获取列表
export const GETLOGGINSEARCH = (params) => {
  return axios({
    url: "loggin/search",
    method: "GET",
    params,
  });
};

// 系统管理-修改密码
export const USERCHANGEPASSWORD = (params) => {
  return axios({
    url: "user/changePassword",
    method: "POST",
    data: params,
  });
};

// 系统管理-代办通知-获取列表
export const GETTODOSEARCH = (params) => {
  return axios({
    url: "todo/search",
    method: "GET",
    params,
  });
};

// 系统管理-代办通知-列表-处理通知
export const UPDATETODOHANDLE = (params) => {
  return axios({
    url: "todo/handle",
    method: "GET",
    params,
  });
};

// 系统管理-回访记录-列表
export const GETRETURNVISITSEARCH = (params) => {
  return axios({
    url: "returnvisit/search",
    method: "GET",
    params,
  });
};

// 系统管理-回访记录-导出excel
export const RETURNVISITEXPORT = BASEURL + "returnvisit/export";

// 系统管理-短信记录-列表
export const GETSMSSEARCH = (params) => {
  return axios({
    url: "sms/search",
    method: "GET",
    params,
  });
};

// 系统管理-短信记录-列表-重新发送
export const SMSRESEND = (params) => {
  return axios({
    url: "sms/resend",
    method: "GET",
    params,
  });
};

// 系统管理-来源配置-列表
export const GETCHANNELSOURCESEARCH = (params) => {
  return axios({
    url: "channelsource/search",
    method: "GET",
    params,
  });
};

// 系统管理-来源配置-列表-新增来源
export const ADDCHANNELSOURCE = (params) => {
  return axios({
    url: "channelsource/add",
    method: "POST",
    data: params,
  });
};

// 系统管理-来源配置-列表-查看来源
export const GETCHANNELSOURCEINFO = (params) => {
  return axios({
    url: "channelsource/info",
    method: "GET",
    params,
  });
};

// 系统管理-来源配置-列表-编辑来源
export const EDITCHANNELSOURCE = (params) => {
  return axios({
    url: "channelsource/edit",
    method: "POST",
    data: params,
  });
};

// 系统管理-来源配置-列表-删除来源
export const DELETECHANNELSOURCE = (params) => {
  return axios({
    url: "channelsource/delete",
    method: "GET",
    params,
  });
};

// 系统管理-广告代号-列表
export const GETADSOURCESEARCH = (params) => {
  return axios({
    url: "adsource/search",
    method: "GET",
    params,
  });
};
// 系统管理-广告代号-列表-新增广告-来源列表
export const GETCHANNELSOURCEOPTIONS = (params) => {
  return axios({
    url: "channelsource/options",
    method: "GET",
    params,
  });
};

// 系统管理-广告代号-列表-新增广告代号
export const ADDADSOURCE = (params) => {
  return axios({
    url: "adsource/add",
    method: "POST",
    data: params,
  });
};

// 系统管理-广告代号-列表-查看广告代号
export const GETADSOURCEINFO = (params) => {
  return axios({
    url: "adsource/info",
    method: "GET",
    params,
  });
};

// 系统管理-广告代号-列表-编辑广告代号
export const EDITADSOURCE = (params) => {
  return axios({
    url: "adsource/edit",
    method: "POST",
    data: params,
  });
};

// 系统管理-广告代号-列表-删除广告代号
export const DELETEADSOURCE = (params) => {
  return axios({
    url: "adsource/delete",
    method: "GET",
    params,
  });
};

// 系统管理-项目配置-列表
export const GETPROJECTSEARCH = (params) => {
  return axios({
    url: "project/search",
    method: "GET",
    params,
  });
};

// 系统管理-项目配置-列表-新增项目
export const ADDPROJECT = (params) => {
  return axios({
    url: "project/add",
    method: "POST",
    data: params,
  });
};

// 系统管理-项目配置-列表-编辑项目
export const EDITPROJECT = (params) => {
  return axios({
    url: "project/edit",
    method: "POST",
    data: params,
  });
};

// 系统管理-项目配置-列表-查看项目
export const GETPROJECTINFO = (params) => {
  return axios({
    url: "project/info",
    method: "GET",
    params,
  });
};

// 系统管理-项目配置-列表-删除项目
export const DELETEPROJECT = (params) => {
  return axios({
    url: "project/delete",
    method: "GET",
    params,
  });
};

// 系统管理-项目配置-列表-查看所有项目（不分页）
export const GETPROJECTOPTIONS = (params) => {
  return axios({
    url: "project/options",
    method: "GET",
    params,
  });
};

// 系统管理-城市配置-列表
export const GETCITYSEARCH = (params) => {
  return axios({
    url: "city/search",
    method: "GET",
    params,
  });
};

// 系统管理-城市配置-列表-新增城市
export const ADDCITYINFO = (params) => {
  return axios({
    url: "city/add",
    method: "POST",
    data: params,
  });
};

// 系统管理-城市配置-列表-编辑城市
export const EDITCITYINFO = (params) => {
  return axios({
    url: "city/edit",
    method: "POST",
    data: params,
  });
};

// 系统管理-城市配置-列表-查看城市
export const GETCITYINFO = (params) => {
  return axios({
    url: "city/info",
    method: "GET",
    params,
  });
};

// 系统管理-城市配置-列表-删除城市
export const DELETECITYINFO = (params) => {
  return axios({
    url: "city/delete",
    method: "GET",
    params,
  });
};

// 系统管理-城市配置-列表-不分页
export const GETCITYOPTIONS = (params) => {
  return axios({
    url: "city/options",
    method: "GET",
    params,
  });
};

// 系统管理-广告代号-列表-不分页
export const GETADSOURCEOPTIONS = (params) => {
  return axios({
    url: "adsource/options",
    method: "GET",
    params,
  });
};

// 系统管理-负责人-列表-不分页
export const GETUSEROPTIONS = (params) => {
  return axios({
    url: "user/options",
    method: "GET",
    params,
  });
};

// 通用-文件上传
export const COMMONFILEUPLOAD = BASEURL + "common/file/upload";

// 排班-获取月度每日排班情况接口-分页
export const GETSCHEDULINGSEARCH = (params) => {
  return axios({
    url: "scheduling/search",
    method: "GET",
    params,
  });
};

// 排班-获取月度每日排班情况接口-不分页
export const GETSCHEDULINGSCHEDULES = (params) => {
  return axios({
    url: "scheduling/schedules",
    method: "GET",
    params,
  });
};

// 预览-业务预览-业务总览
export const GETBUSINESSOVERVIEW = (params) => {
  return axios({
    url: "overview/business/overview",
    method: "GET",
    params,
  });
};

// 预览-业务预览-成交情况
export const GETBUSINESSDEALCHART = (params) => {
  return axios({
    url: "overview/business/dealChart",
    method: "GET",
    params,
  });
};

// 预览-业务预览-成交客单价分布
export const GETUNITPRICEDISTRIBUTION = (params) => {
  return axios({
    url: "overview/business/deal/unitPrice/distribution",
    method: "GET",
    params,
  });
};

// 预览-业务预览-转化率情况
export const GETBUSINESSCONVERSION = (params) => {
  return axios({
    url: "overview/business/conversion",
    method: "GET",
    params,
  });
};

// 预览-业务预览-成交项目分布(人数)
export const GETDEALPROJECTDISTRIBUTION = (params) => {
  return axios({
    url: "overview/business/deal/project/distribution",
    method: "GET",
    params,
  });
};

// 预览-业务预览-单个线索值
export const GETSINGLECLUEOUTPUTVALUE = (params) => {
  return axios({
    url: "overview/business/singleClueOutputValue",
    method: "GET",
    params,
  });
};

// 预览-业务预览-成交客户年龄分布
export const GETCUSTOMERAGEDISTRIBUTION = (params) => {
  return axios({
    url: "overview/business/deal/customerAge/distribution",
    method: "GET",
    params,
  });
};

// 预览-业务预览-客户数据
export const GETCUSTOMERDATA = (params) => {
  return axios({
    url: "overview/business/customerData",
    method: "GET",
    params,
  });
};

// 预览-业务预览-成交客户性别分布
export const GETCUSTOMERGENDERDISTRIBUTION = (params) => {
  return axios({
    url: "overview/business/deal/customerGender/distribution",
    method: "GET",
    params,
  });
};

// 预览-销售预览-待办通知数据
export const GETSALETODODATA = (params) => {
  return axios({
    url: "overview/sale/todoData",
    method: "GET",
    params,
  });
};

// 预览-销售预览-本月目标数据
export const GETSALEMONTHTARGETPROGRESS = (params) => {
  return axios({
    url: "overview/sale/monthTargetProgress",
    method: "GET",
    params,
  });
};

// 预览-销售预览-设置本月目标
export const SETUPTARGETINFO = (params) => {
  return axios({
    url: "overview/sale/setUpTarget",
    method: "POST",
    data: params,
  });
};

// 预览-销售预览-本月业绩排行榜
export const GETSALEPERFORMANCERANKING = (params) => {
  return axios({
    url: "overview/sale/performanceRanking",
    method: "GET",
    params,
  });
};

// 预览-销售预览-获取今日数据
export const GETSALETODAYDATA = (params) => {
  return axios({
    url: "overview/sale/todayData",
    method: "GET",
    params,
  });
};

// 预览-销售预览-获取本周数据
export const GETSALEWEEKDATA = (params) => {
  return axios({
    url: "overview/sale/weekData",
    method: "GET",
    params,
  });
};

// 预览-销售预览-获取本月数据
export const GETSALEMONTHDATA = (params) => {
  return axios({
    url: "overview/sale/monthData",
    method: "GET",
    params,
  });
};

// 预览-销售预览-获取本月转化率
export const GETSALEMONTHCONVERSION = (params) => {
  return axios({
    url: "overview/sale/monthConversion",
    method: "GET",
    params,
  });
};

// 系统管理-广告代号-导出excel
export const ADSOURCEEXPORT = BASEURL + "/adsource/export";

// 代办通知-获取代办通知详情
export const GETTODOINFO = (params) => {
  return axios({
    url: "todo/info",
    method: "GET",
    params,
  });
};

// 代办通知-修改代办通知
export const EDITTODOINFO = (params) => {
  return axios({
    url: "todo/edit",
    method: "POST",
    data: params,
  });
};

// 系统-广告来源-广告代号复合列表查询接口
export const GETCHANNELSOURCECOMPOUNDOPTIONS = (params) => {
  return axios({
    url: "channelsource/compoundOptions",
    method: "GET",
    params,
  });
};

// 医院-城市-医院复合列表查询接口
export const GETHOSPITALCOMPOUNDOPTIONS = (params) => {
  return axios({
    url: "hospital/compoundOptions",
    method: "GET",
    params,
  });
};

// 系统-跟进配置-保存跟进规则
export const SAVEFOLLOWRULES = (params) => {
  return axios({
    url: "followup/setUpRule",
    method: "POST",
    data: params,
  });
};

// 系统-跟进配置-获取跟进规则
export const GETFOLLOWRULES = (params) => {
  return axios({
    url: "followup/rules",
    method: "GET",
    params,
  });
};

// 系统-收款改动-获取列表
export const GETDEALCOLLECTLOGSEARCH = (params) => {
  return axios({
    url: "deal/collectLogSearch",
    method: "GET",
    params,
  });
};

// 概览-日报表-获取每日报表数据
export const GETREPORTDAILYLIST = (params) => {
  return axios({
    url: "overview/report/daily",
    method: "GET",
    params,
  });
};

// 概览-日报表-获取顾问报表数据
export const GETREPORTCONSULTANTLIST = (params) => {
  return axios({
    url: "overview/report/consultant",
    method: "GET",
    params,
  });
};

// 系统-提醒记录
export const GETORDERREMINDSEARCH = (params) => {
  return axios({
    url: "order/remind/search",
    method: "GET",
    params,
  });
};

// 概览-日报表-导出日报表
export const GETREPORTEXPORTDAILY = BASEURL + "/overview/report/exportDaily";

// 概览-日报表-导出顾问报表
export const GETREPORTEXPORTCONSULTANT =
  BASEURL + "/overview/report/exportConsultant";

// 系统-提醒记录-导出
export const GETREMINDEXPORT = BASEURL + "/order/remind/export";

// 系统-用户管理-启用停用
export const UPDATEUSERSTATUS = (params) => {
  return axios({
    url: "user/startstop",
    method: "GET",
    params,
  });
};

// 系统-城市管理-上下架城市
export const UPDATECITYINFO = (params) => {
  return axios({
    url: "city/startstop",
    method: "GET",
    params,
  });
};

// 概览-城市概览-获取列表
export const GETCITYOVERVIEWSEARCH = (params) => {
  return axios({
    url: "overview/city/search",
    method: "GET",
    params,
  });
};

// 概览-城市概览-导出
export const GETCITYOVERVIEWEXPORT = BASEURL + "/overview/city/export";

// 系统-日志管理-获取下拉列表
export const GETLOGGINOPTIONS = (params) => {
  return axios({
    url: "loggin/options",
    method: "GET",
    params,
  });
};

// 系统-日志管理-导出
export const GETLOGGINEXPORT = BASEURL + "/loggin/export";
